Ensure elc timestamps are newer than el files
authorRob Browning <rlb@defaultvalue.org>
Sat, 7 Nov 2015 19:18:39 +0000 (13:18 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sat, 7 Nov 2015 19:19:38 +0000 (13:19 -0600)
Since strip-nodeterminism changes the *.el.gz file timestamps, restore
the timestamps after it runs.  Otherwise, Emacs will think that
corresponding .elc files are stale.

Thanks to Yuri D'Elia <wavexx@thregr.org> for reporting the problem.

Closes: 803060
debian/rules

index e4b17bb530b2164792bc163c15fbf2876a8da9e3..9b083febd9f39747e194e8519691ef6b3c416d6f 100755 (executable)
@@ -607,6 +607,24 @@ override_dh_strip:
        dh_strip -p$(flavor)-nox --dbg-package=$(flavor)-nox-dbg
        dh_strip
 
+# This won't be necessary once strip-nondeterminism is fixed.
+.PHONY: override_dh_strip_nondeterminism
+override_dh_strip_nondeterminism:
+       cp -a debian/emacs24-el/usr/share/emacs/24.5/lisp/version.el.gz \
+         debian/elgz-canary
+       find debian/$(flavor)-el -name "*.el.gz" -printf "%T@ %p\0" \
+         > debian/elgz-info
+       dh_strip_nondeterminism
+       set -eo pipefail; while read -r -d $$'\0' line; do \
+         ts="$${line%% *}"; \
+         path="$${line#* }"; \
+         touch --date=@"$$ts" "$$path"; \
+       done < debian/elgz-info
+       test ! debian/elgz-canary -nt \
+         debian/emacs24-el/usr/share/emacs/24.5/lisp/version.el.gz
+       test ! debian/elgz-canary -ot \
+         debian/emacs24-el/usr/share/emacs/24.5/lisp/version.el.gz
+
 override_dh_testdir:
        $(testdir)
 
@@ -629,6 +647,8 @@ override_dh_clean: $(persistent_autogen_files)
          debian/build-lucid \
          debian/build-nox \
          debian/build-x \
+         debian/elgz-canary \
+         debian/elgz-info \
          debian/emacsVER-common.README.00 \
          debian/emacsVER-common.README.01 \
          debian/install-lucid \